//
//  ViewController.m
//  PrivatePodspec
//
//  Created by YDY on 2024/11/26.
//

#import "ViewController.h"
#import <YLZPrivateLib/YLZReplaceMe.h>
#import <YLZStrategyLib/DMStrategySorter.h>
#import "SceneViewController.h"
#import "StackItemsView.h"
#import "InputView.h"
#import "Masonry.h"




@interface ViewController ()


@property (nonatomic,strong) StackItemsView *oneView;
@property (nonatomic,strong) StackItemsView *twoView;
@property (nonatomic,strong) StackItemsView *threeView;
@property (nonatomic,strong) InputView *itemView;
@property (nonatomic,strong) UIStackView *stackView;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:UIColor.greenColor];
    [YLZReplaceMe one:1 two:100 block:^(NSInteger amount) {
       
        NSLog(@"%ld====",amount);
    }];
    
    
    [YLZReplaceMe userinfo:@"412725198705041516" block:^(Userinfo  *object) {
        
        NSLog(@"%@",object.verify?object.name:@"失败了");
        
    }];
    
    
    [[[DMStrategySorter alloc]init] sortSize:6000000];
    
    
    
    
   
    
    
    
    
    
    
    [self.view addSubview:self.stackView];
    [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.view.mas_top).offset(60);
        make.left.equalTo(self.view.mas_left).offset(10);
        make.right.equalTo(self.view.mas_right).offset(-10);
        make.height.mas_equalTo(400);
    }];
    
    
    
    [self.stackView addArrangedSubview:self.itemView];
    [self.oneView setImage:@"圣诞冰淇淋" title:@"圣诞冰淇淋"];
    [self.twoView setImage:@"圣诞果" title:@"圣诞果"];
    [self.threeView setImage:@"圣诞帽" title:@"圣诞帽"];
    
    
    [self.stackView addArrangedSubview:self.oneView];
    [self.stackView addArrangedSubview:self.twoView];
    [self.stackView addArrangedSubview:self.threeView];
    
    [YLZReplaceMe networkState:1 blokc:^(id  _Nonnull object) {
       
        NSLog(@"当前的网络：%@",object);
    }];

}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    
    [self.oneView setHidden:!self.oneView.hidden];
    
    [self.navigationController pushViewController:[SceneViewController new] animated:YES];
    
}

#pragma mark - lazy
-(UIStackView *)stackView {
    if (!_stackView) {
        
        _stackView = [[UIStackView alloc]init];
        [_stackView setAxis:UILayoutConstraintAxisHorizontal];
        [_stackView setDistribution:UIStackViewDistributionFill];
        [_stackView setAlignment:UIStackViewAlignmentCenter];
        [_stackView setBackgroundColor:UIColor.greenColor];
        [_stackView setSpacing:20.0];
    }
    return _stackView;
}


- (InputView *)itemView {
    if (!_itemView) {
        _itemView = [[InputView alloc]init];
        [_itemView setBackgroundColor:UIColor.orangeColor];
    }
    return _itemView;
}





- (StackItemsView *)oneView {
    
    if (!_oneView) {
        
        _oneView = [[StackItemsView alloc]init];
    }
    return _oneView;
}


- (StackItemsView *)twoView {
    
    if (!_twoView) {
        
        _twoView = [[StackItemsView alloc]init];
    }
    return _twoView;
}


- (StackItemsView *)threeView {
    
    if (!_threeView) {
        
        _threeView = [[StackItemsView alloc]init];
    }
    return _threeView;
}





@end
